
 class EMP {
    private String id;
    private String name;
    private double salary;
    private double bonus;

    public EMP(String id, String name, double salary, double bonus) {
        this.id = id;
        this.name = name;
        this.salary = salary;
        this.bonus = bonus;
    }

     public String getId() {
         return id;
     }

     public String getName() {
         return name;
     }

     public double getSalary() {
         return salary;
     }

     public double getBonus() {
         return bonus;
     }

     public void setId(String id) {
         this.id = id;
     }

     public void setName(String name) {
         this.name = name;
     }

     public void setSalary(double salary) {
         this.salary = salary;
     }

     public void setBonus(double bonus) {
         this.bonus = bonus;
     }
     public void show(){
         System.out.println("姓名："+name);

     }
 }
public class Test2 {
    public static void main(String[] args) {

        EMP gongRen=new EMP("123","张三",5000,1000);
        double gongZi= gongRen.getSalary();
        double jiangJin=gongRen.getBonus();
        double shui=(gongZi+jiangJin-5000)*0.03;
        double realSalary=gongZi+jiangJin-shui;
        String name1=gongRen.getName();
        System.out.println("姓名："+name1);
        System.out.println("实发工资"+realSalary);
        System.out.println("所得税"+shui);
    }
}
